home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc20 / wait.h < prev    next >
C/C++ Source or Header  |  1992-05-15  |  796b  |  44 lines

  1. #ifndef _WAIT_H
  2. #define _WAIT_H
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. struct __wait {
  9. #ifndef __MSHORT__
  10.     unsigned    junk:16;    /* padding to make it 32 bits */
  11. #endif
  12.     unsigned    retcode:8;
  13.     unsigned    coredump:1;
  14.     unsigned    termsig:7;
  15. };
  16.  
  17. union wait {
  18.     struct __wait     _w;
  19.     int        _i;
  20. };
  21.  
  22. #define w_termsig    _w.termsig
  23. #define w_stopsig    _w.retcode
  24. #define w_coredump    _w.coredump
  25. #define w_retcode    _w.retcode
  26.  
  27. /* I don't know if this next one is right or not */
  28. #define w_status    _i
  29.  
  30. #define WSTOPPED    33    /* fake "signal" for stopped processes */
  31.  
  32. #define WIFSIGNALED(x)    ((x)._w.termsig != 0)
  33. #define WIFSTOPPED(x)    ((x)._w.termsig == WSTOPPED)
  34. #define WIFEXITED(x)    ((x)._w.termsig == 0)
  35.  
  36. #define WNOHANG        1
  37. #define WUNTRACED    2
  38.  
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42.  
  43. #endif
  44.